package com.jyxd.web.data.basic;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jyxd.web.data.dto.NurseRecordFormDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 三合一护理单实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel("三合一护理单实体")
@TableName("table_nurse_record_form")   //mybatis-plus标识哪张表
public class NurseRecordForm extends Model<NurseRecordForm> implements Serializable, Cloneable {

    /**
     * 序列
     */
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @Id
    @Column(name = "id", length = 32, nullable = false)
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid.hex")
    @ApiModelProperty("Id")
    private String id;

    @ApiModelProperty("住院号")
    @Column(name = "visit_id")
    private String visitId;

    @ApiModelProperty("本次住院号")
    @Column(name = "visit_code")
    private String visitCode;

    @ApiModelProperty("病人主键id")
    @Column(name = "patient_id")
    private String patientId;

    @ApiModelProperty("关联父级id")
    @Column(name = "parent_id")
    private String parentId;

    @ApiModelProperty("记录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "data_time")
    private Date dataTime;

    @ApiModelProperty("日期")
    private String date;

    @ApiModelProperty("时间")
    private String time;

    @ApiModelProperty("体温")
    @Column(name = "template")
    private String template;

    @ApiModelProperty("心率")
    @Column(name = "hr")
    private String hr;

    @ApiModelProperty("脉率")
    @Column(name = "pulse")
    private String pulse;

    @ApiModelProperty("呼吸")
    @Column(name = "br")
    private String br;

    @ApiModelProperty("无创血压")
    @Column(name = "nbp")
    private String nbp;

    @ApiModelProperty("有创血压")
    @Column(name = "abp")
    private String abp;

    @ApiModelProperty("意识")
    @Column(name = "consciousness")
    private String consciousness;

    @ApiModelProperty("是否使用镇静剂")
    @Column(name = "drag_flag")
    private String dragFlag;

    @ApiModelProperty("血糖")
    @Column(name = "blood_glucose")
    private String bloodGlucose;

    @ApiModelProperty("瞳孔大小左")
    @Column(name = "pupil_size_left")
    private String pupilSizeLeft;

    @ApiModelProperty("瞳孔大小右")
    @Column(name = "pupil_size_right")
    private String pupilSizeRight;

    @ApiModelProperty("瞳孔反应左")
    @Column(name = "pupil_response_left")
    private String pupilResponseLeft;

    @ApiModelProperty("瞳孔反应右")
    @Column(name = "pupil_response_right")
    private String pupilResponseRight;

    @ApiModelProperty("心律")
    @Column(name = "heart_rhythm")
    private String heartRhythm;

    @ApiModelProperty("SPO2")
    @Column(name = "spO2")
    @TableField("spo2")
    private String spO2;

    @ApiModelProperty("CVP")
    @Column(name = "cvp")
    private String cvp;

    @ApiModelProperty("吸氧方式")
    @Column(name = "oxygen_mode")
    private String oxygenMode;

    @ApiModelProperty("FiO2(%)")
    @Column(name = "fio2")
    private String fio2;

    @ApiModelProperty("氧流量(L/分)")
    @Column(name = "oxygen_flow")
    private String oxygenFlow;

    @ApiModelProperty("护理活动（活动/翻身/卧位）")
    @Column(name = "nurse_activity")
    private String nurseActivity;

    @ApiModelProperty("导管/长度")
    @Column(name = "pipe_length")
    private String pipeLength;

    @ApiModelProperty("导管/护理")
    @Column(name = "pipe_nurse")
    private String pipeNurse;

    @ApiModelProperty("胃管长度")
    @Column(name = "stomach_tube_length")
    private String stomachTubeLength;

    @ApiModelProperty("胃管是否通畅")
    @Column(name = "stomach_tube_unobstructed")
    private String stomachTubeUnobstructed;

    @ApiModelProperty("鼻肠管长度")
    @Column(name = "nasointestinal_tube_length")
    private String nasointestinalTubeLength;

    @ApiModelProperty("鼻肠管是否通畅")
    @Column(name = "nasointestinal_tube_unobstructed")
    private String nasointestinalTubeUnobstructed;

    @ApiModelProperty("护理措施")
    @Column(name = "nurse_measure")
    private String nurseMeasure;

    @ApiModelProperty("护理皮肤")
    @Column(name = "nurse_skin")
    private String nurseSkin;

    @ApiModelProperty("药物内容")
    @Column(name = "medicine_content")
    private String medicineContent;

    /**
     * 医嘱编码（同步时使用）
     */
    @Column(name = "order_code")
    private String orderCode;

    /**
     * 医嘱主键
     */
    @Column(name = "order_no")
    private String orderNo;

    /**
     * 子医嘱主键
     */
    @Column(name = "order_sub_no")
    private String orderSubNo;


    @ApiModelProperty("备用量")
    @Column(name = "reserve_amount")
    private String reserveAmount;

    @ApiModelProperty("实入量")
    @Column(name = "practical_amount")
    private String practicalAmount;

    @ApiModelProperty("余量")
    @Column(name = "surplus")
    private String surplus;

    @ApiModelProperty("是否沿用")
    @Column(name = "use_reuse")
    private String useReuse;

    @ApiModelProperty("尿量")
    @Column(name = "urine")
    private String urine;

    @ApiModelProperty("大便")
    @Column(name = "excrement")
    private String excrement;

    @ApiModelProperty("其他")
    @Column(name = "other_out_num")
    private String otherOutNum;

    @ApiModelProperty("出量总量")
    @Column(name = "output_amount")
    private String outputAmount;

    @ApiModelProperty("危急值")
    @Column(name = "critical_value", length = 3000)
    private String criticalValue;

    @ApiModelProperty("相应异常变化的处理及结果")
    @Column(name = "result", length = 3000)
    private String result;

    @ApiModelProperty("签名1")
    @Column(name = "sign")
    private String sign;

    @ApiModelProperty("签名2")
    @Column(name = "second_sign")
    private String secondSign;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time")
    private Date createTime;

    @ApiModelProperty("操作人code")
    @Column(name = "operator_code")
    private String operatorCode;

    @ApiModelProperty("操作人")
    @Column(name = "operator_name")
    private String operatorName;

    @ApiModelProperty("状态（0：禁用 1：正常 -1：删除）")
    @Column(name = "status")
    private int status = 1;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time")
    private Date updateTime;

    @ApiModelProperty("更新人code")
    @Column(name = "operator_code_update")
    private String operatorCodeUpdate;

    @ApiModelProperty("更新人")
    @Column(name = "operator_code_update_name")
    private String operatorCodeUpdateName;

    @ApiModelProperty("总结小结标识")
    @Column(name = "flag")
    private String flag;

    @ApiModelProperty("医嘱时间")
    @TableField(exist = false)
    @Transient
    private String orderId;

    @ApiModelProperty("医嘱时间")
    @TableField(exist = false)
    @Transient
    private String orderTime;

    @ApiModelProperty("出量数据")
    @TableField(exist = false)
    @Transient
    private NurseRecordFormDTO nurseRecordFormDto;

    @ApiModelProperty("模式")
    @Column(name = "mode")
    private String mode;

    @ApiModelProperty("潮气量vt手动设置i吸入,vte呼出，暂为吸入")
    @Column(name = "vt")
    private String vt;

    @ApiModelProperty("通气频率手动设置")
    @Column(name = "f")
    private String f;

    @ApiModelProperty("吸气压力水平手动设置")
    @Column(name = "pinsp")
    private String pinsp;

    @ApiModelProperty("压控模式或压控模式时的吸气压力")
    @Column(name = "pc")
    private String pc;

    @ApiModelProperty("压力支持模式（也称 PSV），或压力支持模式时的吸气压力")
    @Column(name = "ps")
    private String ps;

    @ApiModelProperty("呼气末正压")
    @Column(name = "peep")
    //气道峰压 p-peak
    private String peep;

    @ApiModelProperty("IPAP指的是吸气压力")
    @Column(name = "ipap")
    private String ipap;

    @ApiModelProperty("EPAP指的是呼气压力")
    @Column(name = "epap")
    private String epap;

    @ApiModelProperty("给药途径")
    @Column(name = "use_mode")
    private String useMode;

    @ApiModelProperty("时间改变数据标志，true改变，false未改变")
    @TableField(exist = false)
    @Transient
    private Boolean timeChange;

    @ApiModelProperty("数据来源 0:人工录入 1监护仪自动生成 2护理自动生成")
    @Column(name = "data_source")
    private int dataSource;

    @Override
    public Object clone() throws CloneNotSupportedException {
        NurseRecordForm p = null;
        try {
            p = (NurseRecordForm) super.clone();
        } catch (CloneNotSupportedException e) {
        }
        return super.clone();
    }
}
